<template>
	<view class="container">
		<topnav :title="'购买成功'"></topnav>
		<view class="result-content">
			<image class="result-icon" src="https://hesen-gfn-public.oss-cn-shenzhen.aliyuncs.com/default/detail/success.png" mode="aspectFill"></image>
			<view class="result-tip">购买成功</view>
			<view class="result-tip-content">请到店将二维码出示给商家</view>
			
			<view class="result-btn-box">
				<button class="result-we-btn" open-type='share'>
					<image src="https://hesen-gfn-public.oss-cn-shenzhen.aliyuncs.com/default/detail/wechat.png" mode="aspectFill"></image>
					<view>分享给好友</view>
				</button>
				<view class="result-right-btn" @click="jumpDetail">查看详情</view>
			</view>
		</view>
	</view>
</template>

<script>
	import topnav from '@/components/top-nav/top-nav.vue';
	export default {
		components :{
			topnav
		},
		data() {
			return {
				imgUrl:'',
				goodsId:'',
				id:'',
				type:null
			};
		},
		onLoad(options) {
			console.log(options,'poooo')
			this.id = options.id;
			this.goodsId = options.goodsId;
			this.imgUrl = options.imgUrl;
			this.type = options.type;
		},
		methods:{
			jumpDetail(){
				uni.navigateTo({
					url:'/pages/goodsOrderDetail/goodsOrderDetail?id=' + this.id + '&goodsId=' + this.goodsId+ '&type=' + this.type
				})
			}
		},
		onShareAppMessage(res) {
			let that = this;
			let imageUrl = uni.getStorageSync('shareGoodsImg');
			if(res.from = 'button') {
				return {
					title:'推荐你一个好东西，快来看一看！',
					imageUrl:imageUrl,//../../static/shareGoods.png
					path:'/pages/groupDetail/groupDetail?id=' + that.goodsId
				}
			}
		}
	}
</script>
<style>
	page {
		background: #F4F4F4;
	}
</style>
<style lang="scss">
.result-content {
	text-align: center;
	margin-top: 40%;
}
.result-icon {
	width: 150rpx;
	height: 150rpx;
}
.result-tip {
	font-size: 34rpx;
	font-weight: bold;
	margin-top: 40rpx;
	color: #111111;
	line-height: 48rpx;
}
.result-tip-content {
	font-size: 28rpx;
	color: #333333;
	line-height: 48rpx;
	margin-top: 24rpx;
}
.result-btn-box {
	display: flex;
	justify-content: center;
}
.result-we-btn,.result-right-btn {
	width: 260rpx;
	margin-top: 98rpx!important;
	height: 88rpx;
	line-height: 88rpx;
	border-radius: 44rpx!important;
	font-size: 32rpx!important;
	color: #111111;
	
	image {
		width: 50rpx;
		height: 50rpx;
		margin: 19rpx 12rpx 0 0;
	}
}
.result-right-btn {
	background: #FA6400;
}

.result-we-btn {
	display: flex;
	margin-right: 32rpx!important;
	justify-content: center;
	border:1rpx solid #FA6400!important;
}
</style>
